<template>
	<view class="head">
		<view class="left">
			<text class="title">{{data.mainTitle}}</text>
			<text class="vice" v-if="data.viceFlag">{{data.viceTitle}}</text>
		</view>
		<view class="more" @click="handleMoer">
			<text class="text">更多</text>
			<image class="right" src="@/static/index/chevron-right.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		name: "topHead",
		props: {
			data: null, //object
		},
		methods: {
			handleMoer() {
				let dataType = [];
				if (this.data.moreJunpUrl) {
					dataType = this.data.moreJunpUrl.split("=");
				} else {
					dataType = this.data.junpUrl.split("=");
				}
				uni.navigateTo({
					url: '/pagesA/productList/productList?cate_Id=' + dataType[1]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 24rpx;

		.left {
			display: flex;
			align-items: center;

			.title {
				font-size: 28rpx;
				font-weight: bold;
				margin-right: 10rpx;
			}

			.vice {
				padding-left: 10rpx;
				border-left: 2rpx solid #666666;
				font-size: 22rpx;
				color: #666666;
			}
		}

		.more {
			font-size: 24rpx;
			color: #666666;

			.right {
				margin-left: 12rpx;
				width: 10.76rpx;
				height: 17.84rpx;
			}
		}
	}
</style>
